package command;

import java.io.IOException;

import javax.swing.JButton;

import xml.SaveXML;

import arbori.ArboreFunctional;
import arbori.Nod;

public class SaveArboreXML  extends JButton implements Command {
		
		protected ArboreFunctional a;
		protected String fisier;
		
		public SaveArboreXML(String nume)
		{
			super(nume);
		}
		public void setArbore(Nod n)
		{
			this.a=new ArboreFunctional(n);
		}
		public void setFisier(String n)
		{
			this.fisier=n;
		}
		/**
		 * apeleaza functia care va salva fisierul XML
		 */
		public void execute() //throws IOException
		{
			try{
			SaveXML sxml=new SaveXML(a.getRadacina(),fisier);
			}
			catch (IOException e){System.out.println("Eroare la XML!!!");}

		}
	   
	}
